%%-*- mode: erlang -*-

{mapping, "ezlinker_advisory_plugin.hook.client.connected.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.

{mapping, "ezlinker_advisory_plugin.hook.client.disconnected.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.

{mapping, "ezlinker_advisory_plugin.hook.client.subscribe.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.

{mapping, "ezlinker_advisory_plugin.hook.client.unsubscribe.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.

{mapping, "ezlinker_advisory_plugin.hook.session.subscribed.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.

{mapping, "ezlinker_advisory_plugin.hook.session.unsubscribed.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.

{mapping, "ezlinker_advisory_plugin.hook.message.publish.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.

{mapping, "ezlinker_advisory_plugin.hook.message.acked.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.

{mapping, "ezlinker_advisory_plugin.hook.message.delivered.$name", "ezlinker_advisory_plugin.hooks", [
  {datatype, string}
]}.


{translation, "ezlinker_advisory_plugin.hooks", fun(Conf) ->
  Hooks = cuttlefish_variable:filter_by_prefix("ezlinker_advisory_plugin.hook", Conf),
  lists:map(
    fun({[_, _, Name1, Name2, _], Val}) ->
	  {lists:concat([Name1, ".", Name2]), Val}
	end, Hooks)
end}.
%% ezlinker_advisory_plugin config
{mapping, "ezlinker_advisory_plugin.destination", "ezlinker_advisory_plugin.destination", [
  {datatype, string}
]}.